home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 5566 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: frco.com!usenet
  2. From: Jadam@tcmail.frco.com (Jim Adam)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: NEWBIE:strings, spacing, white_spacing
  5. Date: 5 Feb 1996 18:52:52 GMT
  6. Organization: Fisher Rosemount Systems
  7. Message-ID: <4f5jm4$e5p@rolaids.frco.com>
  8. References: <3111CD7E.2A81@dg.com> <4esavf$sqb@cloner4.netcom.com>
  9. NNTP-Posting-Host: primrose.frco.com
  10. Mime-Version: 1.0
  11. X-Newsreader: WinVN 0.93.11
  12.  
  13. In article <4esavf$sqb@cloner4.netcom.com>, froman@ix.netcom.co says...
  14.  
  15.  
  16. >    I am reading a string (actually many) heres a sample,
  17. >
  18. >The purpose in the real program is to read addresses (the ones on
  19. >letters), and I want to read the address lines in one by one.
  20. >
  21. >When a string is inputed such as      12651 West Alabama Apt 203
  22. >I only receive, as output,            12651
  23. >I am using Borland 4.5
  24.  
  25. In Borland, you can use the C++ STL string class to read an
  26. entire line.  Can't remember the exact name of that function,
  27. but it's something like:
  28.  
  29.   string s;
  30.   s.readline( cin );
  31.    ^^^^^ 
  32.  
  33. Again, I'm not sure exactly what the name of that function
  34. is, but it's something similar to that.
  35.  
  36. This should get all of "12651 West Alabama...." so long as
  37. it appears on one line.  Also, as the C++ string class can
  38. dynamically resize itself, you have no worries on that front.
  39.  
  40. Hope this helps,
  41.  
  42. Jim
  43. Jadam@tcmail.frco.com
  44.  
  45.